//
// Created by hkkzzxz on 24-8-31.
//

#ifndef YUNSHI_SINGLETON_H
#define YUNSHI_SINGLETON_H

// 单例模板类

template<typename T>
class Singleton {
public:
    static T *getInstance() {
        static T instanse;
        return &instanse;
    }

protected:
    Singleton() {}

    virtual ~Singleton() {}

private:
    Singleton(const Singleton &) = delete;

    Singleton &operator=(const Singleton &) = delete;

    Singleton(Singleton &&) = delete;

    Singleton &operator=(Singleton &&) = delete;
};

#endif //YUNSHI_SINGLETON_H
